function onShowErrorMessage() {
    var element = document.getElementById('error_description');
    if (element) {
        if (element.style.display == 'none')
            element.style.display = 'block';
        else
            element.style.display = 'none';
    }
    return true;
}

function onChangedTable(i) {
    document.getElementById('table-selection').value = i;
    return true;
}

document.getElementsByClassName=function(tagName, clsName) {
    var arr = new Array();
    var elems = document.getElementsByTagName(tagName);
    for(var cls, i = 0; (elem = elems[i]); i++ ) {
        if (elem.className == clsName)
            arr[arr.length] = elem;
    }
    return arr;
}

function checkRowSelection() {
    var arr = document.getElementsByClassName('input', 'checkbox');
    var count = 0;
    for(var i=0; i<arr.length; i++)
        if (arr[i].checked)
            count++;
    if (count != 0) {
        document.getElementById('delete').style.display = 'inline';
        if (count == 1)
            document.getElementById('edit').style.display = 'inline';
        else
            document.getElementById('edit').style.display = 'none';
    } else {
        document.getElementById('delete').style.display = 'none';
        document.getElementById('edit').style.display = 'none';
    }
}


